<template>
	<div>
		<span>{{Category}}</span>
		<span><a @click="delect()">删除</a></span>
	</div>
</template>

<script>
import axios from 'axios'
export default {
	props:['Category','CategoryId'],
	methods:{
		delect(){
			console.log(this.CategoryId)
			axios.post('/admin/delect',{
				CategoryId:this.CategoryId
			}).then(response=>{
				if(response.data.code==200 && response.data.message){
					console.log("删除成功")
					this.$router.push({name:'admin-home'})
				}
			})
		}
	},
	created(){
		console.log(this.CategoryId)
	}
}
</script>

<style lang="stylus" scoped>
span 
		float left
		width 20%
		text-align center
		border-bottom 1px solid #ccc
		border-left 1px solid #ccc
		line-height 30px
	span:nth-child(1)
		border-top 1px solid #ccc
	span:nth-child(2)
		border-right  1px solid #ccc
		border-top 1px solid #ccc
</style>

